Replace <noun> with word you want to 'get' e.g. User. Capitalize the first letter
Replace <table> with the SQL table name

	<cffunction name="get<noun>" returntype="struct" access="public">
		<cfargument name="id" type="numeric" required="false" default="-1">
		<!--- optional --->
		<cfargument name="tag" type="string" required="false" default="" hint="Can be a list of tags">

		<cfset var local = {}>
		<cfset local.the<noun>s = get<noun>s(id=arguments.id, tag=arguments.tag)>

		<cfif ArrayLen(local.the<noun>s) eq 0>
			<cfset local.the<noun> = {success=false}>
		<cfelse>
			<cfset local.the<noun> = local.the<noun>[1]>
			<cfset local.the<noun>.success = true>
		</cfif>

		<cfreturn local.the<noun>>
	</cffunction>

	<cffunction name="get<noun>s" returntype="array" access="public">
		<cfargument name="id" type="numeric" required="false" default="-1">
		<!--- Optional --->
		<cfargument name="tag" type="string" required="false" default="">

		<cfset var local = {}>
		<cfquery name="local.get<noun>" datasource="#getSetting('dsEcch')#">
			SELECT *
			FROM <table>
			WHERE 1 = 1
			<cfif arguments.id gt 0>
				AND ID = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.id#">
			<cfelseif Len(arguments.tag)>
				AND tag IN (<cfqueryparam cfsqltype="cf_sql_char" value="#arguments.tag#" list="true">)
			</cfif>
		</cfquery>

		<cfif local.get<noun>.recordCount eq 0>
			<cfset local.data = []>
		<cfelse>
			<cfset local.data = getFactory("dataTypeConvert").queryToArray(local.get<noun>)>
		</cfif>

		<cfreturn local.data>
	</cffunction>
